﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_Week2_Redone
{
    public partial class Form1 : Form
    {
        private void ChangeLanguage(string Lang)
        {
           foreach (Control c in this.Controls)
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(Lang);
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(Lang));
            }
        }
        public Form1()
        {
            
            InitializeComponent();
            
        }

        private void NFormBtn_Click(object sender, EventArgs e)
        {
            Form2 newForm = new Form2();
            newForm.Show();
        }

        private void IconBtn_Click(object sender, EventArgs e)
        {
            //System.Drawing.Icon = Properties.Resources.Icon1;
            this.Icon = Properties.Resources.Icon1;
            
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void LanguageBtn_Click(object sender, EventArgs e)
        {
            if (LanguageBtn.Text == "Change Language")
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl-NL");
                ChangeLanguage("nl-NL");
            }
            else
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
                ChangeLanguage("en");
            }
        }

        private void ClassBtn_Click(object sender, EventArgs e)
        {
            
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            textBox1.Text = numbers[0]+", "+numbers[1]+", "+numbers[2];

        }

        private void ResetBtn_Click(object sender, EventArgs e)
        {
            this.Icon = null;
        }
   }
}

